{% extends theme("base.html") %}
{% from theme('_comments.html') import comment_filed with context%}
{% block ext_css %}
    {{ super() }}
    <link href="{{ url_for('static',filename='ext/syntaxhighlighter_2/Styles/shCore.css') }}" rel="stylesheet"
          type="text/css">
    <link href="{{ url_for('static',filename='ext/syntaxhighlighter_2/Styles/shThemeDefault.css') }}"
          rel="stylesheet" type="text/css">
    <link href="{{ url_for('static',filename='js/kindeditor/plugins/code/prettify.css') }}" rel="stylesheet"
          type="text/css">
{% endblock %}
{% block meta %}
    {{ super() }}
    <meta name="description" content="{{ article.title }}"/>
    <meta name="keywords" content="{{ article.tag }}"/>
{% endblock %}
{% block content %}
    <div class="container white">
        <div class="pull-right">
            <br/>
            <script type="text/javascript">
                (function () {
                    var p = {
                        url: location.href, /*获取URL，可加上来自分享到QQ标识，方便统计*/
                        desc: '', /*分享理由(风格应模拟用户对话),支持多分享语随机展现（使用|分隔）*/
                        title: '', /*分享标题(可选)*/
                        summary: '', /*分享摘要(可选)*/
                        pics: '', /*分享图片(可选)*/
                        flash: '', /*视频地址(可选)*/
                        site: '', /*分享来源(可选) 如：QQ分享*/
                        style: '102',
                        width: 63,
                        height: 24
                    };
                    var s = [];
                    for (var i in p) {
                        s.push(i + '=' + encodeURIComponent(p[i] || ''));
                    }
                    document.write(['<a class="qcShareQQDiv pull-right" href="http://connect.qq.com/widget/shareqq/index.html?', s.join('&'), '" target="_blank">分享到QQ</a>'].join(''));
                })();
            </script>
        </div>
        <div class="text-center h3">
            {{ article.title }}
        </div>
        <hr/>
        <div>
            {{ article.body|safe }}
        </div>
        <br>

        <div class="row-fluid">
            <div class="col-lg-3">
                本文地址：<a href="{{ url_for('article.show',aid = article.id) }}">{{ article.title }}</a>
            </div>

            <div class="col-lg-3">
                <a href="{{ request.headers['Referer'] }}" class="btn btn-success ">
                    <span class="glyphicon glyphicon-circle-arrow-left"></span>返回</a>
                </a>
            </div>
            {% if g.user.is_authenticated() and g.user.is_admin() %}
                <div class="col-lg-3">
                    <a href="{{ url_for('article.edit',id=article.id) }}" class="btn btn-success ">编辑</a>
                </div>
            {% endif %}
        </div>
        <hr/>
        <h3><span class="label label-info"></span></h3>
        {{ comment_filed(form=form,comments=comments) }}
    </div>
{% endblock %}
{% block script %}
    {{ super() }}
    <script type="text/javascript"
            src="{{ url_for('static', filename='ext/syntaxhighlighter_2/Scripts/shCore.js') }}"></script>
    <script type="text/javascript"
            src="{{ url_for('static', filename='ext/syntaxhighlighter_2/Scripts/shBrushPython.js') }}"></script>
    <script type="text/javascript"
            src="{{ url_for('static', filename='ext/syntaxhighlighter_2/Scripts/shBrushCSharp.js') }}"></script>
    <script type="text/javascript"
            src="{{ url_for('static', filename='ext/syntaxhighlighter_2/Scripts/shBrushPhp.js') }}"></script>
    <script type="text/javascript"
            src="{{ url_for('static', filename='ext/syntaxhighlighter_2/Scripts/shBrushJScript.js') }}"></script>
    <script type="text/javascript"
            src="{{ url_for('static', filename='ext/syntaxhighlighter_2/Scripts/shBrushJava.js') }}"></script>
    <script type="text/javascript"
            src="{{ url_for('static', filename='ext/syntaxhighlighter_2/Scripts/shBrushVb.js') }}"></script>
    <script type="text/javascript"
            src="{{ url_for('static', filename='ext/syntaxhighlighter_2/Scripts/shBrushSql.js') }}"></script>
    <script type="text/javascript"
            src="{{ url_for('static', filename='ext/syntaxhighlighter_2/Scripts/shBrushXml.js') }}"></script>
    <script type="text/javascript"
            src="{{ url_for('static', filename='ext/syntaxhighlighter_2/Scripts/shBrushDelphi.js') }}"></script>
    <script type="text/javascript"
            src="{{ url_for('static', filename='ext/syntaxhighlighter_2/Scripts/shBrushCss.js') }}"></script>
    <script type="text/javascript"
            src="{{ url_for('static', filename='ext/syntaxhighlighter_2/Scripts/shBrushRuby.js') }}"></script>
    <script type="text/javascript"
            src="{{ url_for('static', filename='ext/syntaxhighlighter_2/Scripts/shBrushCpp.js') }}"></script>
    <script type="text/javascript">
        SyntaxHighlighter.config.clipboardSwf = '{{ url_for('static', filename='ext/syntaxhighlighter_2/Scripts/clipboard.swf') }}';
        SyntaxHighlighter.config.strings = {
            expandSource: '展开代码',
            viewSource: '查看代码',
            copyToClipboard: '复制代码',
            copyToClipboardConfirmation: '代码复制成功',
            print: '打印',
            help: '?',
            alert: '语法高亮\n\n',
            noBrush: '不能找到刷子: ',
            brushNotHtmlScript: '刷子没有配置html-script选项',
            aboutDialog: '<div></div>'
        };
        SyntaxHighlighter.all();
    </script>
    <script type="text/javascript"
            src="{{ url_for('static', filename='js/kindeditor/plugins/code/prettify.js') }}"></script>
    <script>
        prettyPrint();
    </script>
    <script src="http://connect.qq.com/widget/loader/loader.js" widget="shareqq" charset="utf-8"></script>
{% endblock %}

